//水仙花数
//153 = 1*1*1 + 5*5*5 + 3*3*3= 1 + 125 + 27 =153
import java.sql.SQLOutput;
import java.util.Scanner;
public class test_01 {
    public static void main(String[] args) {
         int count = 0;
         for(int i = 1;i <= 1000;i++){
             int ge = i % 10;// 153 % 10 = 3
             int shi = i / 10 % 10;// 153 / 10 = 15 % 10 = 5;
             int bai = i / 10 / 10 % 10;// 153 / 10 = 15 / 10 = 1 % 10 =1
             if( ge*ge*ge + shi*shi*shi + bai*bai*bai==i){
                 count++;
                 System.out.println(i);
             }
         }
        System.out.println(count);
    }
}
